package com.wangy.service.impl;

import com.wangy.bean.MonitorDetail;
import com.wangy.bean.SchedulerJobInfo;
import com.wangy.mapper.SchedulerMapper;
import com.wangy.service.SchedulerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @author yyzb
 * @date 2024/12/30 19:29
 */
@Service
public class SchedulerServiceImpl implements SchedulerService {

    @Autowired
    SchedulerMapper schedulerMapper;

    @Override
    public List<SchedulerJobInfo> getAllJobs() {
        return schedulerMapper.getAllJobs();
    }

    @Override
    public void pauseJob(SchedulerJobInfo jobInfo) {
        schedulerMapper.pauseJob(jobInfo);
    }

    @Override
    public void resumeJob(SchedulerJobInfo jobInfo) {
        schedulerMapper.resumeJob(jobInfo);
    }

    @Override
    public void deleteJob(SchedulerJobInfo jobInfo) {
        schedulerMapper.deleteJob(jobInfo);
    }

    @Override
    public void addJob(SchedulerJobInfo jobInfo) {
        schedulerMapper.addJob(jobInfo);
    }

    @Override
    public Double computeNullRate(String tableName, String fieldName) {
        Double nullRate = schedulerMapper.computeNullRate(tableName, fieldName);
        return nullRate;
    }

    @Override
    public void insertRecord(MonitorDetail monitorDetail) {
        schedulerMapper.insertRecord(monitorDetail);
    }
}
